package org.point.dao.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.point.common.dao.impl.BaseDaoImpl;
import org.point.common.util.DoPage;
import org.point.dao.UserTaskDao;
import org.point.domain.UserTask;
import org.springframework.stereotype.Repository;

/**
 * 
 * @ClassName: ConvertRuleDetailDaoImpl  
 * @Description: TODO(兑换规则明细数据实现类)  
 * @author Kenny_Z' szqiuk@gmail.com
 * @date 2016年10月23日 下午3:28:17  
 *
 */
@Repository("UserTaskDao")
public class UserTaskDaoImpl extends BaseDaoImpl<UserTask, Serializable> implements UserTaskDao {

	private static final String SQLID_SEARCHFORUSERTASKPAGE = "search_For_UserTask_page";
	private static final String SQLID_SEARCHFORUSERTASKCOUNT = "search_For_UserTask_count";
	private static final String SQLID_SEARCHUSERTASK = "search_userTask";

	public UserTaskDaoImpl() {
		namespace = super.getNamespace();
	}

	
	public List<UserTask> searchForUserTask(DoPage<UserTask> page) {
		List<UserTask> records = null;
		try {
			records = getSqlSession().selectList(namespace + SQLID_SEARCHFORUSERTASKPAGE, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return records;
	}

	public Integer searchUserTaskCount(DoPage<UserTask> page) {
		Integer result = 0;
		try {
			result = getSqlSession().selectOne(namespace + SQLID_SEARCHFORUSERTASKCOUNT, page);
		} catch (Exception e) {
			throw new RuntimeException("查询数据总记录数错误！", e);
		}
		return result;
	}

	public List<UserTask> searchUserTaskMap(Map<String, Object> map) {
		List<UserTask> userTasks = getSqlSession().selectList(namespace + SQLID_SEARCHUSERTASK);
		return userTasks;
	}

	
}
